from strategy.StrategyTemplate import StrategyTemplate


class ThreeFactorsRank(StrategyTemplate):
    """
    三因子策略:
        三因素值=双低值+溢价率-到期税前收益，由低到高排序

    """
    def run(self):
        pd = self.pd[~ self.pd['price_tips'].str.contains("待上市")]
        pd.eval("sort=双低+溢价率-到期税前收益",inplace=True)
        # pd = pd[pd['现价'] < 125]

        self.pd = pd.sort_values(by='sort',ascending=True)